package parking;

import java.util.Comparator;
import java.util.List;
import java.util.Optional;

public class SuperParkBoy extends ParkBoy{

    SuperParkBoy(ParkLot... parkLots){
        super(parkLots);
    }

    @Override
    protected Optional<ParkLot> findParkLot() {
        return lotList.stream().filter(ParkLot::hasSpace).max(Comparator.comparingDouble(ParkLot::vacancyRate));
    }
}
